package com.qyhl.webtv.commonlib.item;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import com.qyhl.webtv.commonlib.R;
import com.qyhl.webtv.commonlib.entity.news.GlobalNewsBean;
import com.zhy.adapter.recyclerview.base.ItemViewDelegate;
import com.zhy.adapter.recyclerview.base.ViewHolder;

public class ItemOtherAdv implements ItemViewDelegate<GlobalNewsBean> {
    private Activity activity;

    public ItemOtherAdv(Activity activity) {
        this.activity = activity;
    }

    @Override
    public int getItemViewLayoutId() {
        return R.layout.news_item_newslist_adv_other;
    }

    @Override
    public boolean isForViewType(GlobalNewsBean globalNewsBean, int i) {
        return "101".equals(globalNewsBean.getType());
    }

    @Override
    public void convert(final ViewHolder viewHolder, GlobalNewsBean globalNewsBean, int i) {
//        RelativeLayout root = viewHolder.getView(R.id.root);
//        root.removeAllViews();
//        PtgNativeExpressAd ad = globalNewsBean.getAd();
//        View adView = ad.getExpressAdView();
//        if (adView.getParent() != null) {
//            ((ViewGroup) adView.getParent()).removeView(adView);
//        }
//        root.addView(adView);
    }
}
